/**
 * Created by Adi(adi@imeth.cn) on 2016/11/3.
 */
/**
 * Created by Adi on 16/8/16.
 */
"use strict";

import { compose, createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import Reducers from './reducer/index'
import createLogger from 'redux-logger';

let middlewares=[thunk];

if (process.env.NODE_ENV === 'development') {
	const logger = createLogger();
	middlewares.push(logger);
}

let	buildStore = compose(applyMiddleware(...middlewares))(createStore);

export default function configureStore(initialState) {
	const store = buildStore(Reducers, initialState);
	return store
}